'use strict';
/**
 * create dispatcher
 */
var util = require('util');
var path = require('path');
var ScriptBase = require('../../lib/script-base');
var _ = require('underscore');
/**
* Constructor
*/
var Generator = module.exports = function()
{
    ScriptBase.apply(this , arguments);

    this.changeEventName = 'CHANGE';
};

util.inherits(Generator , ScriptBase);

/**
 * ask for a change event name
 */
Generator.prototype.askForChangeEventName = function()
{
    if (this.interactive) {
        var cb = this.async();
        this.prompt({
            type: 'input',
            message: (this.lang==='en') ? 'Change Event Name' : '改变事件名称',
            name: 'changeEventName'
            default: 'CHANGE'
        } , function(props)
        {
            this.changeEventName = props.changeEventName;
            cb();
        }.bind(this));
    }
};

/**
* createing files
*/
Generator.prototype.createDispatcherFile = function()
{
    this.dispatcherName = this.classedName;

    this.appTemplate('dispatcher', path.join('scripts' , 'dispatchers' , this.name));

};
